package com.commander.spring.cloud.controller;

import com.alibaba.fastjson.JSON;
import com.commander.spring.cloud.dao.order.OrderEntity;
import com.commander.spring.cloud.feignservice.FeignUserService;
import com.commander.spring.cloud.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 * <p>
 * Date: 2020-06-05
 * <p>
 * Time: 16:06
 *
 * @author zhangxin
 */
@RestController
@RequestMapping(path = "/order")
public class OrderController {
	
	@Autowired
	private OrderService orderService;
	@Autowired
	private FeignUserService userService;
	
	@RequestMapping(path = "/id/{id}", method = RequestMethod.GET)
	public OrderEntity getById(@PathVariable("id") String id){
		Object user = userService.getById("3");
		System.out.println(JSON.toJSONString(user));
		return orderService.getById(id);
	}
}
